/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * NewJApplet.java
 *
 * Created on Oct 5, 2009, 9:40:43 PM
 */
package GUIUtilities;

import SocialMatrixPackage.SocialMatrix;
import java.util.Vector;
import javax.swing.tree.DefaultMutableTreeNode;

/**
 *
 * @author Heather
 */
public class NewJApplet extends javax.swing.JApplet
{

  /** Initializes the applet NewJApplet */
  public void init()
  {
    try
    {
      java.awt.EventQueue.invokeAndWait(new Runnable()
      {

        public void run()
        {
          initComponents();
          DefaultMutableTreeNode targetRoot = (DefaultMutableTreeNode) target.getModel().getRoot();
          targetRoot.removeAllChildren();
          target.updateUI();
          //targetRoot.add(new DefaultMutableTreeNode("fuck this"));

          TreeUtilities.cloneTree(source, target, 2);
          target.updateUI();

          /*
          Vector<int[]> testCoalition = new Vector<int[]>();
          int[] t1 =
          {
            0, 0, 0
          };
          int[] t2 =
          {
            1, 1, 1
          };
          int[] t3 =
          {
            2, 0, 2
          };
          int[] t4 =
          {
            0, 0, 3
          };
          int[] t5 =
          {
            1, 1, 2
          };
          int[] t6 =
          {
            2, 0, 0
          };

          testCoalition.add(t1);
          testCoalition.add(t2);
          testCoalition.add(t3);
          testCoalition.add(t4);
          testCoalition.add(t5);
          testCoalition.add(t6);

          SocialMatrix sm = new SocialMatrix (source);
          CoalitionTreeLoader.loadCoaltionIntoTree(source, sm, testCoalition);
           */
        }
      });
    } catch (Exception ex)
    {
      ex.printStackTrace();
    }
  }

  /** This method is called from within the init() method to
   * initialize the form.
   * WARNING: Do NOT modify this code. The content of this method is
   * always regenerated by the Form Editor.
   */
  @SuppressWarnings("unchecked")
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {

    jScrollPane1 = new javax.swing.JScrollPane();
    source = new javax.swing.JTree();
    jScrollPane2 = new javax.swing.JScrollPane();
    target = new javax.swing.JTree();

    jScrollPane1.setViewportView(source);

    jScrollPane2.setViewportView(target);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(layout.createSequentialGroup()
        .addContainerGap()
        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );
    layout.setVerticalGroup(
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
          .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 443, Short.MAX_VALUE)
          .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 443, Short.MAX_VALUE))
        .addContainerGap())
    );
  }// </editor-fold>//GEN-END:initComponents
  // Variables declaration - do not modify//GEN-BEGIN:variables
  private javax.swing.JScrollPane jScrollPane1;
  private javax.swing.JScrollPane jScrollPane2;
  private javax.swing.JTree source;
  private javax.swing.JTree target;
  // End of variables declaration//GEN-END:variables
}
